<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAppVersionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('app_versions', function (Blueprint $table) {
            $table->increments('id')->comment('app安装包版本管理');
            $table->string('version_name', 255)->nullable()->comment('版本名称');
            $table->text('version_remark')->nullable()->comment('版本备注');
            $table->string('version_num', 64)->nullable()->comment('版本号');
            $table->tinyInteger('push_state')->nullable()->comment('发布状态')->default(0);
            $table->string('download_url', 255)->nullable()->comment('下载地址');
            $table->integer('download_num')->nullable()->comment('下载次数')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('app_version');
    }
}
